1. Field of the Invention
The present invention relates to tools for developing applications for an application server. More specifically, the present invention relates to a method and an apparatus that facilitates creating a hierarchical model from a programming language file that contains components, in a manner that allows the components to be subsequently identified by referencing the hierarchical model.
2. Related Art
The rapid proliferation of computer technology in recent years has been facilitated by significant advances in the design of user interfaces, which have made computer programs significantly easier to use. As these user interfaces become increasingly more sophisticated, a significantly larger percentage of an application developer's time is dedicated to developing user interfaces. This development process typically involves tedious and time-consuming manipulations of the various graphical components that comprise a user interface.
A number of tools have been developed to simplify the process of developing user interfaces. Some of these tools provide a WYSIWYG (What You See Is What You Get) editor, which allows an application developer to manipulate the graphical components that comprise a user interface.
It is difficult to build a WYSIWYG design tool that allows a user to manipulate a component in the WYSIWYG view and to make corresponding changes to the associated component in the source file. This is especially true for JavaServer Faces (JSF) components in situations where a component is embedded within another component. In this situation, a component is free to replicate a subcomponent's rendered HyperText Markup Language (HTML) or ignore it altogether. For example, a “tabbed window” JSF component will render exactly one of its children—the one corresponding to the selected tab. In general, given a JSF component hierarchy, it is difficult to determine which portions of the HTML correspond to which individual components in the hierarchy.
The following example illustrates this problem. Consider the block of code in JSF source file 100, illustrated in FIG. 1A. When this block of code is rendered using JSF's render kit, corresponding JSF-rendered HyperText Markup Language (HTML) 110 is produced as is illustrated in FIG. 1B. In FIG. 1B, the bold line <input type=“submit” value=“Submit”/> corresponds to the bold line <h:commandButton value=“Submit”/> from JSF source file 100. Everything else in JSF-rendered HTML 110 comes from the <h:panelGrid> component from JSF source file 100.
While the system can compute the HTML stream to render at design time, the challenge is being able to identify which portions of the HTML correspond to specific individual components in the source file, without having any special knowledge of the individual components and what HTML they generate. It is important to be able to do this in a development tool. For example, if a user clicks on the button (rendered from the <input type=“submit” value=“Submit”/> tag above), the corresponding <h:commandButton value=“Submit”/> component is selected and its properties are displayed in a property sheet in the development tool. In order to accomplish this, the system needs to determine which HTML elements from JSF rendered HTML 110 correspond to which components in JSF source file 100 as illustrated in FIG. 1C.
Hence, what is needed is a method and an apparatus for identifying components in a source file that generated a markup stream in a markup file.